#!/usr/bin/env python
# coding=utf-8
from datetime import timedelta


class BaseConfig(object):
    # DEBUG = True
    SQLALCHEMY_TRACK_MODIFICATIONS = True
    # SQLALCHEMY_COMMIT_ON_TEARDOWN = True
    SQLALCHEMY_RECORD_QUERIES = True
    # SQLALCHEMY_DATABASE_URI = os.environ.get('DATABASE_URL') or \
    #     'sqlite:///' + os.path.join(basedir, 'data.sqlite')
    SQLALCHEMY_DATABASE_URI = 'mysql+pymysql://user:password@host:port/nxshare?charset=utf8mb4'
    ARTICLES_PER_PAGE = 15
    CLUB_PER_PAGE = 15
    POST_PER_PAGE = 8
    USER_POST_PER_PAGE = 8
    ARTICLES_PER_DEPART = 8
    ADMIN_USER_PER_DEPART = 15
    ACCESS_RECORD_PER_PAGE = 15
    COMMENTS_PER_PAGE = 6
    SECRET_KEY = b'0f22f790ba48288d62fa4e02e5360002ba6e343ac334a0989e63698422819044'
    WTF_CSRF_SECRET_KEY = 'random key for form' # for csrf protection

    BACKEND_DOMAIN = ''

    PERMANENT_SESSION_LIFETIME = timedelta(days=7)

    # 文件路径
    UPLOAD_TYPE = "aliyun"
    UPLOAD_FOLDER = "/www/static/uplodas/"

    # 阿里云配置
    ALIYUN_ACCESS_ID = "LTAIpUhqsqLPhXuf6Mdfasdf"
    ALIYUN_SECRET_ACCESS_KEY = "CsdfsdfefasAHaj5QotJ4dS6Px "
    ALIYUN_BUCKET = "nxshare"
    ALIYUN_HOST = "oss-cn-beijing.aliyuncs.com"
    # ALIYUN_HOST = "oss-cn-beijing-internal.aliyuncs.com"
    # ALIYUN_INNER_NET = "https://static.juzizhou.net"
    ALIYUN_INNER_NET = "http://imgx.xshare.cn/"
    ALIYUN_OUTER_NET = "http://nxshare.oss-cn-beijing.aliyuncs.com/"
    ALIYUN_NET = "https://nxshare.oss-cn-beijing.aliyuncs.com/"


    @staticmethod
    def init_app(app):
        pass